package com.cvo.scrumtoolkit.client.controller;

import com.google.gwt.user.client.ui.Button;

/**
 * Every view should be registered here so it can be called upon
 * 
 * @author Ricardo Capplelle
 *
 */
public enum View {
	HOME("com.cvo.scrumtoolkit.client.pannels.ProjectStorePanel.java"),
	PRODUCTBACKLOG("com.cvo.scrumtoolkit.client.pannels.BacklogPanel"), 
	SPRINTBACKLOG("com.cvo.scrumtoolkit.client.pannels.SprintOverviewPanel"),
	BURNDOWNCHART(""),
	SCRUMBOARD(""),
	MENU("com.cvo.scrumtoolkit.client.pannels.MenuPanel"),
	DEFAULTPANEL("com.cvo.scrumtoolkit.client.pannels.DefaultPanel");
	
	
	private final String viewName;
		
	
	View (String viewName){
		this.viewName = viewName;
		
	}
		
	public String getViewName() {
		if(this.viewName==""){
			return View.DEFAULTPANEL.viewName;
		}
		return viewName;
	}
	
	
	
	public static View getByShortname(String shortname){
		if(shortname.toLowerCase().equals("home")){
			return HOME;
		}else if(shortname.toLowerCase().equals("projectbacklog")){
			return PRODUCTBACKLOG;
	
		}else if(shortname.toLowerCase().equals("sprintbacklog")){
			return SPRINTBACKLOG;
			}else if(shortname.toLowerCase().equals("burndownchart")){
			return BURNDOWNCHART;
		}else if(shortname.toLowerCase().equals("scrumboard")){
			return SCRUMBOARD;
		}//TODO: do it for each view
		return DEFAULTPANEL;
	}
}
